package cc.realxyq.springboot.elasticsearch.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author : [buleing]
 * @version : [v1.0]
 * @description : [一句话描述该类的功能]
 * @createTime : [2021/6/10 19:51]
 * @updateUser : [buleing]
 * @updateTime : [2021/6/10 19:51]
 * @updateRemark : [说明本次修改内容]
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "item_index")
public class Product {
    @Id
    private Long id;
    //, analyzer = "ik_max_word"

    @Field(type = FieldType.Text)
    private String title;

    @Field(type = FieldType.Keyword)
    private String category;

    @Field(type = FieldType.Keyword)
    private String brand;

    @Field(type = FieldType.Double)
    private Double price;

    @Field(index = false, type = FieldType.Keyword)
    private String images;
}
